﻿@using KRM.Core
@model KRM.Core.tblPersonal
@{
    ViewBag.Title = "Edit Employees Info";
    tblUser tblUser = ViewBag.tblUser;
}

<form action="/Employees/EditEmployees" method="POST" class="form-horizontal"enctype="multipart/form-data">
    <input type="hidden" value="@Model.Id" name="Id"/>
    <div class="form-body">
        <h3 class="form-section" style="margin-top: -10px">Personal Info</h3>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">Full Name<span class="required">*</span></label>
                    <div class="col-md-9">
                        <input type="text" name="FullName"class="form-control" required="required" value="@Model.FullName">
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">Address<span class="required">*</span></label>
                    <div class="col-md-9">
                        <input type="text" name="Address"class="form-control" required="required"value="@Model.Address">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
             
                <div class="form-group">
                    <label class="control-label col-md-3">Mobile Phone</label>
                    <div class="col-md-9">
                        <input type="text" name="MobileTelephoneNumber"class="form-control"  value="@Model.MobileTelephoneNumber">
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">Home Phone</label>
                    <div class="col-md-9">
                        <input type="text" name="HomeTelephoneNumber"class="form-control" value="@Model.HomeTelephoneNumber">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">Email Address</label>
                    <div class="col-md-9">
                        <input type="text" name="EmailAddress"class="form-control"value="@Model.EmailAddress">
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">Nationality</label>
                    <div class="col-md-9">
                        <input type="text" name="Nationality"class="form-control" value="@Model.Nationality">
                    </div>
                </div>
            </div></div>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">Ethnicity</label>
                    <div class="col-md-9">
                        <input type="text" name="Ethnicity"class="form-control" value="@Model.Ethnicity">
                    </div>
                </div></div>
            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">National Insurance Number</label>
                    <div class="col-md-9">
                        <input type="text" name="NationalInsuranceNumber" class="form-control"value="@Model.NationalInsuranceNumber">
                    </div>
                </div>
            </div>

        </div>

        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">Gender</label>
                    <div class="col-md-9">
                        <select name ="Gender"class="form-control">
                            <option @(Model.Gender==true?"selected=selected":"") value="true">Male</option>
                            <option @(Model.Gender==false?"selected=selected":"") value="false">Female</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">Date Of Birth<span class="required">*</span></label>
                    <div class="col-md-9">
                        <div id =""class="input-group input-medium date date-picker" data-date="@DateTime.Now" data-date-format="mm/dd/yyyy" data-date-viewmode="years">
                            <input type="text" name="DateOfBirth" class="form-control"required="required"placeholder="mm/dd/yyyy" value="@Model.DateOfBirth.ToString("MM/d/yyyy")" >
                            <span class="input-group-btn">
                                <button class="btn default" type="button"><i class="icon-calendar"></i></button>
                            </span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">Passport Number</label>
                    <div class="col-md-9">
                        <input type="text" name="PassportNumber" class="form-control" value="@Model.PassportNumber">
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">Driving Licence Number</label>
                    <div class="col-md-9">
                        <input type="text" name="DrivingLicenceNumber" class="form-control" value="@Model.DrivingLicenceNumber">
                    </div>
                </div>   
            </div>       
        </div>
        
        <h3 class="form-section">Account Info</h3>
        <div class="row">
            <div class="col-md-6">
                    <div class="form-group">
                        <div class="col-md-3"><label class="control-label ">Avatar Images</label></div>
                        <div class="col-md-9">
                            <div class="fileupload fileupload-new" data-provides="fileupload">
                                <div class="fileupload-new thumbnail" style="width: 200px; height: 150px;">
                                    <img src="@(Model.Image!=null?"/Upload/Avatar/"+Model.Image:"http://www.placehold.it/200x150/EFEFEF/AAAAAA&amp;text=no+image")" alt="">
                                </div>
                                <div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 200px; max-height: 150px; line-height: 20px;"></div>
                                <div>
                                    <span class="btn default btn-file">
                                        <span class="fileupload-new"><i class="icon-paper-clip"></i> Select image</span>
                                        <span class="fileupload-exists"><i class="icon-undo"></i> Change</span>
                                        <input type="file" class="default" name="image">
                                    </span>
                                    <a href="#" class="btn red fileupload-exists" data-dismiss="fileupload"><i class="icon-trash"></i> Remove</a>
                                </div>
                            </div>
                            <span class="label label-danger">NOTE!</span>
                            <span>
                                Attached image thumbnail is
                                supported in Latest Firefox, Chrome, Opera, 
                                Safari and Internet Explorer 10 only
                            </span>
                        </div>
                    </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-4">User Login<span class="required">*</span></label>
                    <div class="col-md-8">
                        <input type="text" name="UserLogin" class="form-control"required="required" value="@Model.User.UserLogin">
                    </div>
                </div> 
                <div class="form-group">
                    <label class="control-label col-md-4">User Name<span class="required">*</span></label>
                    <div class="col-md-8">
                        <input type="text" name="UserName" class="form-control"required="required" value="@Model.User.Username">
                    </div>
                </div> 
                <div class="form-group" >
                    <label class="control-label col-md-4">Password</label>
                    <input type="hidden" name="UserPassword" id="UserPassword" class="form-control" required="required"value="@Model.User.UserPassword">
                    <div class="col-md-8"  id="ResetPasswordFormControl">
                        <button type="button" class="btn btn-default" onclick="SetPassworDefault(@Model.User.UserID)" id='btnReserPassword'><i class="icon-refresh"></i> Reset to default</button>
                    </div>
                </div>   
                @*<div class="form-group">
                    <label class="control-label col-md-4">Web Department</label>
                    <div class="col-md-8">
                       @Html.DropDownList("WebDepartmentId",null,new{@class="form-control"})
                    </div>
                </div>   *@
                <div class="form-group">
                    <label class="control-label col-md-4">Phone User Name</label>
                    <div class="col-md-8">
                        <input type="text" name="PhoneUserName" class="form-control"required="required" value="@ViewBag.PhoneUserName">

                    </div>
                </div>
                                <div class="form-group">
                    <label class="control-label col-md-4">KRM Department</label>
                    <div class="col-md-8">
                       @Html.DropDownList("KRMDepartmentId",null,new{@class="form-control"})
                    </div>
                </div>   
  
            </div>       
        </div>

    </div>
    <div class="form-actions fluid">
        <div class="row">
            <div class="col-md-6">
                <div class="col-md-offset-3 col-md-9">
                    <button type="submit" class="btn btn green"><i class="icon-ok"></i>Save Changes</button>
                       <button type="reset" class="btn btn-default">Reset</button>                               
                </div>
            </div>
            <div class="col-md-6">
            </div>
        </div>
    </div>
</form>